This resource address creates a CPF configuration for the database.
URL Parameters | |
---|---|
format | The format of the request body. Can be either
html , json , or xml (default). This value overrides
the Accept header if both are present. |
Upon success, MarkLogic Server returns status code 201 (Created). If the payload is malformed or the database does not exist, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.
manage-user
role, or the following
privilege: http://marklogic.com/xdmp/privileges/manage
http://marklogic.com/xdmp/privileges/manage-admin
conversion-enabled
boolean logically maps onto the
conversion-enabled
setting contained within domain configuration. Note: The
properties described here are for XML payloads. In general they are the same for JSON, with
the exception that, in JSON, permissions
is expressed in singular form. For
example, in JSON, permissions
is instead permission
and the format
is as shown in the example below.
domain-name
restart-user-name
eval-module
eval-root
conversion-enabled
permissions
This is a complex structure with the following children:
permission
This is a complex structure with the following children:
role-name
capability
# load default pipelines (Status Change Handling & Flexible Replication) # on the Triggers database. curl -X POST --anyauth --user admin:admin --header \ "Content-Type:application/json" -d'{"operation":"load-default-cpf-pipelines"}' \ http://localhost:8002/manage/v2/databases/Triggers/pipelines?format=json # create a CPF domain for Flexible Replication on the Triggers database. cat domain_payload.json ==> { "domain-name": "myDomain", "description": "mydesc", "scope": "directory", "uri": "/", "depth": "infinity", "eval-module": "Modules", "eval-root": "/", "pipeline":["Status Change Handling","Flexible Replication"] } curl -X POST --anyauth --user admin:admin --header \ "Content-Type:application/json" -d@domain_payload.json \ http://localhost:8002/manage/v2/databases/Triggers/domains?format=json # Install and configure CPF on the Triggers database. cat setup-cpf.json ==> { "domain-name": "myDomain", "restart-user-name": "admin", "eval-module": "Modules", "eval-root": "/", "conversion-enabled": true, "permission": [{ "role-name": "app-user", "capability": "read" }] }' curl -X POST --anyauth --user admin:admin --header "Content-Type:application/json" \ -d@setup-cpf.json http://localhost:8002/manage/v2/databases/Triggers/cpf-configs?format=json
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.